﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="passwordchange.aspx.cs" Inherits="User_passwordchange" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>修改密码</title>
    <link rel="stylesheet" type="text/css" href="../CSS/Style.css" />
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
        function checkpwd()
        {
           if ($.trim($("#txtOldPwd").val())!=""&&$("#txtOldPwd").val().length>3)
            {
                $.ajax({
                type:"GET",
                url:"Common/CheckPwd.ashx",
                dataType:"html",
                data:"userpwd="+$("#txtOldPwd").val()+"&userid="+$("#labID").val(),
                beforeSend:function(XMLHttpRequest)
                    {
                        $("#showresult").text("正在验证密码....");
                    },
                success:function(msg)
                    {   
                        if (msg=="yes")
                         {
                             $("#showresult").html("密码正确，请开始输入新密码！");
                             $("#showresult").css("color","green");
                             $("#txtOldPwd").css("border","1px solid green");
                         } 
                       else
                       {
                             $("#showresult").html("该密码错误，请重新输入原密码！");
                             $("#showresult").css("color","#a40000");
                             $("#txtOldPwd").css("border","1px solid #a40000");
                       } 
                    },
               complete:function(XMLHttpRequest,textStatus)
                    {
                        //隐藏正在查询图片
                    },
              error:function()
                   {
                            //错误处理
//                             $("#showresult").html("该密码错误，请重新输入原密码！");
//                             $("#showresult").css("color","#a40000");
//                             $("#txtOldPwd").css("border","1px solid #a40000");
                   }
                });
           }  
           else
           {
                 $("#showresult").html("输入字符长度不低于<em>4</em>个. 此项不可为空!");
                 $("#showresult").css("color","#a40000");
                 $("#txtOldPwd").css("border","1px solid #a40000");
                return false; 
           }  
    }
 
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="padding:50px 50px; text-align:center;">
        <table style="width: 800px;">
            <tr>
                <td style="width:200px;">
                    您的工号是：
                </td>
                <td style="text-align:left;">
                    <asp:Label ID="labID" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    原密码：</td>
                <td style="text-align:left;">
                    <asp:TextBox ID="txtOldPwd" runat="server" TextMode="Password" Width="180px" onblur='checkpwd();'></asp:TextBox><span id="showresult"></span>
                    </td>
            </tr>
            <tr>
                <td>
                    新密码：</td>
                <td style="text-align:left;">
                    <asp:TextBox ID="txtNewPwd1" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    重复新密码：</td>
                <td style="text-align:left;">
                    <asp:TextBox ID="txtNewPwd2" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="text-align:left;">
                    忘记原密码？请联系管理员进行重置。</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="Button1" runat="server" CssClass="btn-dy-blue" Text="确认" 
                        onclick="Button1_Click" />
                    <asp:Button ID="Button2" runat="server" CssClass="btn-dy-blue" Text="放弃" />
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                    </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div id="note" runat="server"></div></td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

